<template>
	<view class="wrap flex column align-center">
		<view class="wrap-content">
			<view class="item flex align-center">
				<view class="title f-26">注册时间：{{ start_time }}</view>
			</view>

			<view class="item flex align-center">
				<view class="title f-26">到期时间：{{ end_time }}</view>
			</view>

			<view class="item flex align-center">
				<view class="title f-26">已缴端口费：{{ price }}</view>
			</view>

			<view class="item flex align-center">
				<view class="title f-26">注销身份说明：</view>
			</view>

			<view class="item">
				<textarea class="textarea f-26" placeholder="请输入注销身份说明" v-model="content" />
			</view>
		</view>

		<view class="theme-gradient-btn f-30" @click="onSubmit">提交</view>
	</view>
</template>

<script>
	import { ApplyCancelPartner } from "@/API/partner.js";
	export default {
		data() {
			return {
				start_time: "", //开始时间
				end_time: "", //结束时间
				price: "", //端口费
				content: "", //注销原因
			};
		},
		onLoad() {
			this.$commonNetwork.getUserIdenInfoData((res) => {
				this.start_time = res.start_time_text;
				this.end_time = res.end_time_text;
				this.price = res.port_fee;
			});
		},
		methods: {
			/**
			 * 提交
			 */
			onSubmit() {
				if (this.content.trim() === "") {
					this.$st.show("请输入注销身份说明");
					return;
				}
				this.$throttle(() => {
					this.submitData();
				});
			},
			submitData() {
				ApplyCancelPartner(this.content).then((res) => {
					this.$st.success("提交成功,请等待管理员审核", () => {
						uni.navigateBack();
					});
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.wrap {
		padding: 20rpx 25rpx;
		box-sizing: border-box;
		gap: 50rpx;

		.wrap-content {
			width: 100%;
			background-color: white;
			border-radius: 10rpx;
			overflow: hidden;
			padding: 30rpx 20rpx;
			box-sizing: border-box;

			.item {
				width: 100%;
				overflow: hidden;
				margin-bottom: 30rpx;

				&:last-child {
					margin-bottom: 0rpx;
				}

				.title {
					color: #333333;
				}

				.textarea {
					width: 100%;
					height: 200rpx;
					background-color: #f6f6f6;
					border-radius: 10rpx;
					padding: 20rpx;
					box-sizing: border-box;
				}
			}
		}
	}
</style>
